<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<!--_meta 作为公共模版分离出去-->
<!DOCTYPE HTML>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
    <link rel="stylesheet" type="text/css"
          href="${pageContext.request.contextPath}/assets/H-ui/static/h-ui/css/H-ui.min.css"/>
    <%--引起冲突的样式--%>
    <%--<link rel="stylesheet" href="${pageContext.request.contextPath}/assets/css/table.css"/>--%>
    <link rel="stylesheet" type="text/css"
          href="${pageContext.request.contextPath}/assets/H-ui/lib/Hui-iconfont/1.0.8/iconfont.css"/>
    <link rel="stylesheet" type="text/css"
          href="${pageContext.request.contextPath}/assets/H-ui/static/h-ui.admin/skin/default/skin.css" id="skin"/>
    <link rel="stylesheet" type="text/css"
          href="${pageContext.request.contextPath}/assets/H-ui/static/h-ui.admin/css/style.css"/>
    <link rel="stylesheet" href="${pageContext.request.contextPath}/assets/css/bootstrap.css"/>
    <!--_footer 作为公共模版分离出去-->
    <script src="${pageContext.request.contextPath}/assets/js/jquery.min.js"></script>
    <script src="${pageContext.request.contextPath}/assets/js/bootstrap.min.js"></script>
    <!--/_footer /作为公共模版分离出去-->
    <title>报告列表管理 - </title>
</head>
<body>
<h3 align="center">报告管理列表</h3>
<div align="center">
    <form action="${pageContext.request.contextPath}/report/reportManage.action">
        <input type="num" value="1" hidden id="num" name="num">
        体检人员: <input type="text" id="userName" name="userName" value="${param.userName}">
        报告状态：<select id="stateName" name="stateName" value="${param.stateName}">
        <option></option>
        <option value="未完成" ${param.stateName eq '未完成'?'selected':''}>未完成</option>
        <option value="已完成" ${param.stateName eq '已完成'?'selected':''}>已完成</option>
                </select>
        <input type="submit" value="搜索报告">
    </form>
</div>
<br>
<table class="table table-border table-bordered table-hover table-bg table-sort">
    <thead>
    <tr class="text-c">
        <th width="100">报告ID</th>
        <th width="90">体检用户</th>
        <th width="90">选择项目时间</th>
        <th width="30">报告状态</th>
        <th width="100">操作</th>
    </tr>
    </thead>
    <tbody>
    <c:if test="${not empty page}">
        <c:forEach items="${page.list}" var="report">
            <tr class="text-c">
            <td>${report.reportId}</td>
            <td>${report.user.userName}</td>
            <td>${report.reportTime}</td>
            <td>${report.state.stateName}</td>
            <c:if test="${report.stateId eq 14}">
                <td class="td-manage">
                    <a href="${pageContext.request.contextPath}/report/report_print.action?reportId=${report.reportId}"
                       class="btn-primary btn-sm">预览</a>
                </td>
                </tr>
            </c:if>
            <c:if test="${report.stateId eq 11}">
                <td class="td-manage">
                    <a href="${pageContext.request.contextPath}/report/reportImformation.action?num=1&reportId=${report.reportId}"
                       class="btn-primary btn-sm">报告详情</a>
                    <a href="${pageContext.request.contextPath}/report/report_guide_print.action?reportId=${report.reportId}"
                       class="btn-primary btn-sm">打印导检单</a>
                </td>
                </tr>
            </c:if>
        </c:forEach>
    </c:if>
    </tbody>
</table>
<div id="page" style="float: right" align="center">
    总共${page.pages}页，当前第${page.pageNum}页,每页总共${page.pageSize},总共记录数${page.total}条.
    <a id="firstPage" class="btn-sm btn-primary" onclick="changeNum(${page.prePage})">上一页</a>
    <a id="lastPage" class="btn-sm btn-primary" onclick="changeNum(${page.nextPage})">下一页</a>
</div>
<script type="text/javascript">
    $(function () {
        if (${page.isLastPage}) {
            $("#lastPage").removeAttr("onclick");
        }
    });

    function changeNum(obj) {
        //console.log(num);
        var form=$("form");
        $("input[name='num']").val(obj);
        form.method="post";
        form.submit();
        // var num = obj;
        <%--window.location.href = "${pageContext.request.contextPath}/report/reportManage.action?num=" + num;--%>
    }


</script>
<!--/请在上方写此页面业务相关的脚本-->
</body>
</html>